﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<script language="c#" runat="server">
protected string CurrentCategoryID
{
	get
	{
		if (!String.IsNullOrEmpty(Request.QueryString["CategoryID"]) && Request.QueryString["CategoryID"] != Guid.Empty.ToString())
			return Request.QueryString["CategoryID"];
		else if (Request.Cookies["CategoryID"] != null && Request.Cookies["CategoryID"].Value != Guid.Empty.ToString())
			return Request.Cookies["CategoryID"].Value;
		else
			return "";
	}
}
</script>
<section data-page="menu_list" data-title="菜单列表" data-lang="<%=ContentLang%>">
	<dl class="path1">
		<dt><span>您的位置：</span>菜单列表</dt>
		<dd>
			<select data-class="<%=ContentLang%>Font" data-ali-widget="combo">
				<ali:List Object="Language" Source="Manager.Languages">
					<ali:Record>
						<%If Convert.ToString(Ab) == ContentLang%>
							<option value="<%=Ab%>" selected><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%Else%>
							<option value="<%=Ab%>"><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%EndIf%>
					</ali:Record>
				</ali:List>
			</select>
		</dd>
	</dl>
	<div class="ali-tabs sub-nav" data-height-style="fill" data-event="click">
		<div class="ali-tabs-header">
			<div class="ali-tabs-nav-container">
				<ul>
					<li class="ali-active"><a>菜单列表</a></li>
					<li><a href="add.aspx?Lang=<%=ContentLang%>" target="ali-navtab">添加菜单</a></li>
                    <li><a href="../menu_category/list.aspx?Lang=<%=ContentLang%>" target="ali-navtab">类别列表</a></li>
                    <li><a href="../menu_category/add.aspx?Lang=<%=ContentLang%>" target="ali-navtab">添加类别</a></li>
				</ul>				
			</div>
		</div>
		<div class="ali-tabs-body">
			<div class="ali-tabs-panel">						
				<form action="?Lang=<%=ContentLang%>" class="search1">
					<select name="CategoryID" data-class="<%=ContentLang%>Font" data-ali-widget="combo" data-tree="true" data-root="">
						<option data-item="" data-parent="" value="">公共菜单</option>
						<ali:Tree Object="MenuCategory">
							<ali:Record>
								<%If Convert.ToString(ID) == CurrentCategoryID%>
									<option data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>" value="<%=ID%>" selected><%=Name%></option>
								<%Else%>
									<option data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>" value="<%=ID%>"><%=Name%></option>
								<%EndIf%>
								<%=ChildRecords%>
							</ali:Record>
						</ali:Tree>
					</select>
				</form>
				<div class="content">
					<table data-ali-widget="grid" class="grid1" data-tree="true" data-root="">
						<thead>
							<tr>
								<th width="50">移动</th>
								<th>名称及层次</th>
								<th width="80">是否显示</th>
								<th width="80">删除</th>
							</tr>
						</thead>
						<tbody>
                            <ali:Tree Object="Menu" Condition="CategoryID=CurrentCategoryID" Validate="True">
                                <ali:Record>
                                    <tr data-id="<%=InnerID%>">
                                         <td data-sort="<%=InnerID%>" data-name="<%=Name%>"><%=InnerID%></td>
										 <th data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>" class="<%=ContentLang%>Font"><a href="edit.aspx?Lang=<%=ContentLang%>&amp;CategoryID=<%=CategoryID%>&amp;ID=<%=InnerID%>" target="ali-navtab"><%=Name%></a></th>
										 <td>
										 	<%If Convert.ToBoolean(IsDisplay)%>
												显示
											<%Else%>
												不显示
											<%EndIf%>
										</td>
                                         <td><a class="ali-button" data-operation="Delete">删除</a></td>
                                    </tr>
									<%=ChildRecords%>
                                </ali:Record>
                            </ali:Tree>
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<div class="ali-tabs-bottom"><b></b></div>
	</div>
</section>